package sxe.core.pair.list;

import snobject.snNil;
import snobject.snObject;
import snobject.snObjectArgList;
import snobject.snPair;
import step.EvaluationFailure;
import step.FunctionWrapper;

public class create extends FunctionWrapper {

	public create() {
		super();
	}

	@Override
	public snObject Call(snObjectArgList argv) throws EvaluationFailure,
			ClassCastException {
	
		snPair p = new snPair(argv.popObject(),snNil.NIL);
		snPair c = null;
		
		while(argv.hasNext()){
			c = new snPair(argv.popObject(),p);
			p = c;
		}
				
		return(p);
	}
}
